package com.glsc.ngateway.common.api.oaflow.dto.xirtrade;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.glsc.ngateway.common.api.common.dto.AppendIdDto;
import com.glsc.ngateway.common.api.common.dto.BaseEntityDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.springframework.data.annotation.Transient;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * oa同步自研网关记录实体类_资金运营部
 *
 * @author xuchang
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class TOaFlowXirTradeBaseInfoDto extends BaseEntityDto {

    private static final long serialVersionUID = -3264094474527903316L;

    @ApiModelProperty(value = "衡泰指令")
    private String instId;

    @ApiModelProperty(value = "交易金额")
    private BigDecimal changeAmount;

    @ApiModelProperty(value = "交易金额")
    private String changeAmountStr;

    @ApiModelProperty(value = "首次结算日期")
    private String settleBeginDate;

    @ApiModelProperty(value = "到期结算日期")
    private String settleEndDate;

    @ApiModelProperty(value = "借贷期限（天数）")
    private Integer settleDays;

    @ApiModelProperty(value = "借贷费用描述")
    private String settleFeeDesc;

    @ApiModelProperty(value = "借贷费率（如：0.23%）")
    private BigDecimal settleFeeRate;

    @ApiModelProperty(value = "借贷费率（如：0.23%）")
    private String settleFeeRateStr;

    @ApiModelProperty(value = "借贷费用")
    private BigDecimal settleFeeAmount;

    @ApiModelProperty(value = "衡泰指令（首期）")
    private String instIdFirst;

    @ApiModelProperty(value = "衡泰指令（到期）")
    private String instIdEnd;

    @ApiModelProperty(value = "业务状态")
    private String dealStatus;

    @ApiModelProperty(value = "OA流程类型ID")
    private String workflowId;

    @ApiModelProperty(value = "OA流程实例ID")
    private String requestId;

    @ApiModelProperty(value = "OA流程实例标题")
    private String requestTitle;

    @ApiModelProperty(value = "结算关联内部交易号")
    private String intordid;

    @ApiModelProperty(value = "交易序号")
    private String sysordid;

    @ApiModelProperty(value = "衡泰业务类型")
    private String xirBizType;

    @ApiModelProperty(value = "衡泰业务类型（中文）")
    private String xirBizTypeName;

    @ApiModelProperty(value = "本方资金账户代码")
    private String cashAccid;

    @ApiModelProperty(value = "本方证券账户代码")
    private String secuAccid;

    @ApiModelProperty(value = "对手方id")
    private String partyId;

    @ApiModelProperty(value = "对手方名称")
    private String partyName;

    @ApiModelProperty(value = "对手方开户行行号")
    private String partyBankCode;

    @ApiModelProperty(value = "对手方开户行")
    private String partyBankAccName;

    @ApiModelProperty(value = "对手方银行账号")
    private String partyAccCode;

    @ApiModelProperty(value = "对手方户名")
    private String partyAccName;

    @ApiModelProperty(value = "交易摘要")
    private String bizBrief;

    @ApiModelProperty(value = "交易员")
    private String dealer;

    @ApiModelProperty(value = "oa发起人")
    private String applicant;

    @ApiModelProperty(value = "交易员/oa发起人")
    private String dealerAndApplicant;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @ApiModelProperty(value = "触发时间")
    private LocalDateTime syncTime;

    @Transient
    private String applicantDepart;

    @Transient
    private String applicantComp;
    /**
     * 流程标题
     */
    @Transient
    private String title;
    /**
     * 附件
     */
    @Transient
    private AppendIdDto fj;
    /**
     * // 创建时是否停留在提交者0 会提交到第二个节点，1  停留在提交人。默认0
     */
    @Builder.Default
    @Transient
    private String isnextflow = "0";

    @Transient
    private String deptTitle;

}
